/*package com.data;

import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;


*//**
 * @author emylyano3
 *
 *//*
public class XmlImporter implements XmlTags {
	
	public static final int BYTE_VALUE = 8;
	public static final int NIBBLE_VALUE = 4;
	public static final int BIT_VALUE = 1;
	
	int templateId = -1;
	int pageId = -1;
	
	TemplatePage[] page;
	byte[] color = new byte[3];
	
	public  TemplateMenu[] importXml (String path){
		File file = new File(path);
		TemplateMenu[] menus = new TemplateMenu[2];
		System.out.println("File: " + file);
		try	{
			InputStream xmlData = new FileInputStream(file);
			String buffer = "";
			while(xmlData.available() != 0) {
				buffer += (char)(xmlData.read());
				System.out.println(buffer);
				for(int i = 0 ; i < STRINGS.length ; i++) {
					if(buffer.length() >= STRINGS[i].length()) {
						String tag = "";
						for(int j = buffer.length() - STRINGS[i].length(); j < buffer.length(); j++) {
							tag += buffer.charAt(j);
						}
						if(tag.equals(STRINGS[i])) {
							System.out.println("          MATCH!");
							buffer = buffer.substring(0, buffer.length() - STRINGS[i].length());
							byte[] tempData = null;
							if(STRINGS[i].charAt(1) == '/') {
								tempData = buffer.getBytes();
							}	
							switch(i) {
								case TEMPLATE_OPENER:
									buffer = "";
									templateId = (int)((char)(xmlData.read()));
									menus[templateId] = new TemplateMenu();
									//page[templateId] = new TemplateMenu();
									pageId = -1;
								break;
								
								case TEMPLATE_CLOSER:							
									buffer = "";
									templateId = -1;
								break;
								
								case FOREGROUND_COLOR_OPENER:
									buffer = "";
								break;
								
								case FOREGROUND_COLOR_CLOSER:	
									color = readColor(tempData);
									if(templateId != -1) {
										menus[templateId].setForegroundColor(color);
									}
									if(pageId != -1) {
										page[pageId].setForegroundColor(color);
									}
									buffer = "";
								break;
								
								case BACKGROUND_COLOR_OPENER:
									buffer = "";
								break;
								
								case BACKGROUND_COLOR_CLOSER:
									readColor(tempData);
									color = readColor(tempData);
									System.out.println( (int) (tempData[0]) << 16);
									if(templateId != -1) {
										menus[templateId].setBackgroundColor(color);
									}
									System.out.println(menus[templateId].getBackgroundColor());
									if(pageId != -1) {
										page[pageId].setBackgroundColor(color);
									}
									buffer = "";
								break;
								
								case IMAGE_OPENER:
									buffer = "";
								break;
								
								case IMAGE_CLOSER:
									buffer = "";
								break;
								
								case BEHAVIOR_OPENER:
									buffer = "";
								break;
								
								case BEHAVIOR_CLOSER:
									buffer = "";
								break;
								
								case ENTRIES_OPENER:
									buffer = "";
								break;
								
								case ENTRIES_CLOSER:
									if(templateId != -1) {
										menus[templateId].getEntries()[templateId].text = Splitter.split(new String(tempData), "_");
									}
//									if(pageId != -1) {
//										page[pageId].entries = Splitter.split(new String(tempData), "_"); 
//									}
									buffer = "";
								break;
								
								case PAGE_OPENER:
									buffer = "";
									pageId = (int)((char)(xmlData.read()));
									templateId = -1;
								break;
								
								case PAGE_CLOSER:
									buffer = "";
									pageId = -1;
								break;
								
								case FONT_COLOR_OPENER:
									buffer = "";
								break;
								
								case FONT_COLOR_CLOSER:
									color = readColor(tempData);
									if(templateId != -1) {
										menus[templateId].setFontColor(color);
									}
									if(pageId != -1) {
										page[pageId].setFontColor(color);
									}
									buffer = "";
								break;
								
								case HIGHLIGHT_COLOR_OPENER:
									buffer = "";
								break;
								
								case HIGHLIGHT_COLOR_CLOSER:
									color = readColor(tempData);
									if(templateId != -1) {
										menus[templateId].setHighlightedColor(color);
									}
									if(pageId != -1){
										page[pageId].setHighlightedColor(color);
									}							
									buffer = "";							
								break;
								
								case TEXT_OPENER:
									buffer = "";
								break;
								
								case TEXT_CLOSER:
									if(templateId != -1) {
										menus[templateId].setText(readBuffer(tempData));
									}
//									if(pageId != -1) {
//										page[pageId].entries = Splitter.split(new String(tempData), "_"); 
//									}
									buffer = "";
								break;
							}						
							break;
						}					
					}				
				}
			}
		}
		catch(Exception e)
		{
			System.out.println("TODO ROTO! " + e.toString());
			e.printStackTrace();
		}
		return menus;
	}
	
	
	String readBuffer(byte[] b) {
		String w = "";
		int i = 0;
		try {
			while(i < b.length) {
				w += (char) b[i];
				++i;
			}
		} catch (Exception e2) {
			e2.printStackTrace();
		}
		return w;
	}
	
	byte[] readColor(byte[] b) {
		byte[] c = new byte[3];
		c[0] = b[0];
		c[1] = b[1];
		c[2] = b[2];
		return c;
	}
	
	byte[] intToByteArray(int theInt, int bytes) { 
		byte[] array = new byte[bytes];
		switch(bytes) { 
			case 4: array[3] = (byte)((theInt >> 24) & 0xFF); 
			case 3: array[2] = (byte)((theInt >> 16) & 0xFF); 
			case 2: array[1] = (byte)((theInt >> 8) & 0xFF); 
			case 1: array[0] = (byte)(theInt & 0xFF); 
		} 
		return array; 
	}

	public static int byteArrayToInt(byte[] b) {
		int I = 0;
		for (int i = 0; i < b.length ; ++i)
			I += (int) b[i] << (b.length - 1 - i) * BYTE_VALUE;
		return I;
	} 
	
}
*/